package io.github.talelin.latticy.controller.api;

import io.github.talelin.core.annotation.LoginRequired;
import io.github.talelin.latticy.dto.SettingConfigDTO;
import io.github.talelin.latticy.entity.Setting;
import io.github.talelin.latticy.service.SettingService;
import io.github.talelin.latticy.vo.CreatedVO;
import io.github.talelin.latticy.vo.UpdatedVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/cms/setting")
@Validated
public class SettingController {

    @Autowired
    private SettingService settingService;

    @PutMapping("/audit")
    @LoginRequired
    public UpdatedVO updateAudit() {
        settingService.updateAudit();
        return new UpdatedVO<>();
    }

    @GetMapping("/audit")
    @LoginRequired
    public Boolean getAudit() {
        return settingService.getAudit();
    }
}
